/**
 * @author: 團長
 * @date: 2014-3-17-下午1:31:19
 */
package net.loyintean.pearlshell.basedb;

import net.loyintean.pearlshell.base.model.ResultData;
import net.loyintean.pearlshell.basedb.exception.TransactionException;

/** special interface for query data from data base.
 * <p>
 * the input and output parameter should be the same class as T
 * <p>
 * 2014-4-2 Loy split this interface into three ones. v2.0.0
 * 
 * @author 團長
 * @since 2014-4-2
 * @version 2.0.0 */
public interface QueryDBService<T> {

	/** query single object from database.
	 * <p>
	 * the sql should find no row, or only one row from database.
	 * 
	 * @author 團長
	 * @since 2014-3-18
	 * @param dto
	 *            status SUCCESS: everything is ok, and the getData() will
	 *            return the dao result.<br>
	 *            status FAIL: the result returned by dao is null.
	 * @return the row queried by the sql. If no data in database, it should be
	 *         null.
	 * @throws TransactionException */
	public ResultData<T> querySingleDto(T dto) throws TransactionException;

}
